<?php
class TotalModel extends Model {
	
	/**
	 * 用户行为记录列表
	 */
	public function memberBehavior($userid){
		
		$module = M("Member");
		$rows   = $module->find($userid);
		$visit  = $rows["visitid"];
		
		import('ORG.Util.Page');
		
		$order  = "addtime desc";
		$map    = array("userid"=>$visit);
		
		$model  = M("Behavior");
		$nums   = 10;
		$count  = $model->where($map)->count();
		$Page   = new Page($count,$nums);
		$show   = $Page->show();
		
		$list   = $model->order($order)->where($map)
				  ->limit($Page->firstRow.','.$Page->listRows)->select();
		return array("page"=>$show,"list"=>$list,"user"=>$rows);
	}
	
	/**
	 * 用户导引用户列表
	 */
	public function memberImport($userid){
	
		$model = D("Api://Behavior");
		$rows  = $model->behaviorChildReg($userid);
		return $rows;
	}

}
		
?>